﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace WindowsFormsApplication1
{
    class ColorEditorTestControl : System.Windows.Forms.UserControl
    {
        private PictureBox pictureBox1;
        private int icolor;

        [EditorAttribute(typeof(ColorEditor), typeof(System.Drawing.Design.UITypeEditor))]
        [Category("Color Control")]
        [BrowsableAttribute(true)]
        public int Color
        {
            get { return icolor; }
            set { icolor = value % 3; }
        }

        private void InitializeComponent()
        {
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.SuspendLayout();
            // 
            // pictureBox1
            // 
            this.pictureBox1.Location = new System.Drawing.Point(3, 3);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(144, 144);
            this.pictureBox1.TabIndex = 0;
            this.pictureBox1.TabStop = false;
            // 
            // ColorEditorTestControl
            // 
            this.Controls.Add(this.pictureBox1);
            this.Name = "ColorEditorTestControl";
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.ResumeLayout(false);

        }
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) 
        {
            /*
            if( this.DesignMode ) 
                e.Graphics.DrawString("Use the Properties Window.");
            else
                e.Graphics.DrawString("This example" );
             */ 
        }
    }
}
